package ee.rumba.iPhoneShop.dictionary;

import java.io.File;

public class Example {
  public static void main(String[] args) throws Exception {
    File dictDatFile = new File("/path/to/english-unigrams.dat");

    // load binary dictionary
    ee.rumba.iPhoneShop.dictionary.iDictionary idict = iDictionary.parseUnigramsDat(dictDatFile);

    // store unigrams.dat
    idict.writeUnigramsDat(new File("/tmp/english-unigrams.dat_new"));

    // stopre unigrams.idx
    idict.writeUnigramsIdx(new File("/tmp/english-unigrams.dat"));

    // store stems.dat
    idict.writeStemsDat(new File("/tmp/english-stems.dat"));

    // create text dump
    idict.writeTextDump(new File("/tmp/engilsh-text.dump.txt"));

    // how to create custom dict

    iDictionary newDict = new iDictionary();
    // new iWord(word, statusBits, upperCaseBits)
    // only status bit known is 0x80 - use uppercase information
    // other bits need to be analysed
    // upperCaseBits - one bit per one character.

    newDict.addiWord(new iWord("word1", 0, false));
    newDict.addiWord(new iWord("word2", 0, false));
    newDict.addiWord(new iWord("word3", 0, false));
    newDict.addiWord(new iWord("word4", 0, false));
    newDict.addiWord(new iWord("word5", 0, false));


    // and call all write methods to have new dictionary
  }
}
